<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<script src="../../resources/js-test.js"></script>
</head>
<body>
<div id="container">
<div id="content" contenteditable><div><ruby>你好<rt>ni hao</rt></ruby></ruby></div>
<ruby><ruby>很<rt>hen</rt></ruby><ruby>好<rt>hao</rt></ruby>？
</div>
<textarea cols=50 rows=5></textarea>
</div>
<script>

description("This tests copying and pasting text with ruby doesn't insert new lines before and after rt\n"
    + "but still inserts a new line around a block element around ruby."
    + "To manually test, copy and paste the text into the textarea. There should be not new line in the textarea.");

var content = document.getElementById('content');
content.focus();
document.execCommand('SelectAll', false, null);
if (document.queryCommandSupported('Copy')) {
    document.execCommand('Copy', false, null);

    var textarea = document.querySelector('textarea');
    var firstLine = content.firstChild.innerText;
    textarea.focus();
    document.execCommand('Paste', false, null);
    shouldBe("textarea.value.indexOf('\\n')", "firstLine.length");

    document.getElementById('container').style.display = 'none';
}

</script>
</body>
</html>
